Ext.define('PHT.CheckURLBtn', {
    extend: 'Ext.button.Button',
    alias: ['widget.chkURLbtn'],

    margin: '30,0,0,60',
    text: 'Check URL',
    autowidth : true,
    maxWidth : 100,
    handler:function(){
//    	var store = Ext.data.StoreManager.lookup('url-report-store');
//    	store.load();
//    	var tabs = Ext.getCmp('report-tab');
//    	tabs.doLayout();
    	Ext.Ajax.request({
    	    url: 'checkURL.do',
    	    success: function(response){
    	        var tabs = Ext.getCmp('report-tab');
    	        tabs.setActiveTab(0);
    	        var url_report_panel = tabs.down('#url-report');
    	        url_report_panel.update(response.responseText.trim());
    	        //var aabb = url_report.down('#url-report-grid');
    	        
//    	        var store = Ext.data.StoreManager.lookup('url-report-store');
    	        
//    	        alert(response.responseText.trim());
//    	        var json = eval("(" + response.responseText.trim() + ")");
//    	        alert(json);
    	        //store.loadData(response.responseText.trim());
//    	        store.load(json);
//    	        store.data = json.checking;
//    	        store.load();
    	        //var bbccc = url_report.down('#url-report-grid');
    	        //url_report_grid.getStore().loadRawData();
    	    },
    	    failure: function(response){
    	       Ext.MessageBox.alert('Check URL Error',response);
    	    }
    	});  	
    },
    initComponent: function() {
        var me = this;
        me.callParent(arguments);
    }
});